export interface UserType {
  id: number;
  name: string;
  email: string;
  title: string;
  organiztion: string;
  token?: string;
}

export interface AuthFormType {
  username: string;
  password: string;
}

export interface AuthContextType {
  user: UserType | null;
  login: (form: AuthFormType) => Promise<void>;
  register: (form: AuthFormType) => Promise<void>;
  logout: () => Promise<void>;
}

export interface HttpConfigType extends RequestInit {
  token?: string;
  data?: Record<string, unknown>;
}

export interface ProjectType {
  name: string;
  personId: number;
  organization: string;
  id: number;
  created: number;
  pin: boolean;
}

export type Row = string | number;

export type ParamType = Pick<ProjectType, "name" | "personId">;

export interface KanbanType {
  id: number;
  name: string;
  projectId: number;
}

export interface TaskType {
  id: number;
  name: string;
  // 经办人
  processorId: number;
  projectId: number;
  // 任务组
  epicId: number;
  kanbanId: number;
  typeId: number;
  note: string;
}

export interface TaskTypesType {
  id: number;
  name: string;
}

export interface SroProps {
  fromId: number;
  referenceId: number;
  type: "before" | "after";
  fromKanbanId?: number;
  toKanbanId?: number;
}

export interface EpicType {
  id: number;
  name: string;
  projectId: number;
  start: number;
  end: number;
}
